<template>

  <FormPanel
      :data="data"
      :selectItem="selectItem"
      :noModel="noModel"
      :hideModel="hideModel"
      :selectForm="selectForm"
      :startType="startType"
      @handleSetSelectItem="handleSetSelectItem">
  </FormPanel>

</template>
<script>
import FormPanel from './item/index';
import {noModelList} from '../config';

export default {
  components: {
    FormPanel,
  },
  data() {
    return {
      updateTime: 0,
      hideModel: false,

      noModel: noModelList,
      startType: '',
      selectItem: {},
    };
  },
  props: {
    data: {
      type: Object,
      required: true,
    },
    selectForm: {
      type: Object,
    },
  },
  methods: {
    handleSetSelectItem(record) {


      let newTime = new Date().getTime();
      if (newTime - this.updateTime < 100) {
        return false;
      }

      this.updateTime = newTime;


      this.selectItem = record;

      this.$emit('changeSelectItem', this.selectItem);


      if (record.key) {
        this.startType = record.type;
      }
    },

  },
};
</script>
